<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<!-- 推荐文章 -->
<div class="topGroup" th:fragment="top-group" th:with='topGroupPosts = ${postFinder.list(1,6)},
    postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg : theme.config.layout.postRandomImg+"?"}'
>
    <div class="recent-post-item"
         th:each="post : ${topGroupPosts}"
         th:if="${#strings.equals(theme.config.top.recommendPost, 'latest')}">

        <div class="post_cover">
            <a th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
                <span class="recent-post-top-text">荐</span>
                <img class="post_bg" loading="lazy"
                     th:alt="${post.spec.title}"
                     th:src='${#strings.isEmpty(post.spec.cover) ? postRandomImg+","+post.spec.title : post.spec.cover}'
                />
            </a>
        </div>
        <div class="recent-post-info">
            <a class="article-title"
               th:href="@{${post.status.permalink}}"
               th:text="${post.spec.title}"
               th:title="${post.spec.title}">
            </a>
        </div>
    </div>
    <!-- 自定义的文章右上角的推荐文章 -->
    <div class="recent-post-item"
         th:each="cuscomPost : ${theme.config.top.recommendPostCustom}"
         th:if="${#strings.equals(theme.config.top.recommendPost, 'custom')}">
        <div class="post_cover">
            <a th:href="@{${cuscomPost.url}}" th:title="${cuscomPost.title}">
                <span class="recent-post-top-text">荐</span>
                <img class="post_bg" loading="lazy"
                     th:alt="${cuscomPost.title}"
                     th:src='${#strings.isEmpty(cuscomPost.cover) ? postRandomImg+","+cuscomPost.title : cuscomPost.cover}'
                />
            </a>
        </div>
        <div class="recent-post-info">
            <a class="article-title"
               th:href="@{${cuscomPost.url}}"
               th:text="${cuscomPost.title}"
               th:title="${cuscomPost.title}">
            </a>
        </div>
    </div>

    <!-- 今日推荐 -->
    <div class="todayCard" id="todayCard"
         th:if="${theme.config.top.todayRecommend}"
         th:attr="onclick='javascript:window.open(\''+ ${theme.config.top.todayRecommendContent.todayRecommendUrl} +'\')'">
        <div class="todayCard-info">
            <div class="todayCard-tips">今日推荐</div>
            <div class="todayCard-title" th:text="${theme.config.top.todayRecommendContent.todayRecommendTitle}"></div>
        </div>
        <div class="todayCard-cover"
             th:style="'background:url('+ ${theme.config.top.todayRecommendContent.todayRecommendCover} +') no-repeat center/cover'">
        </div>
        <div class="banner-button-group">
            <a class="banner-button" onclick="window.event.cancelBubble=!0;heo.hideTodayCard()">
                <i class="iconfont icon-plus-circle"></i>
                <span class="banner-button-text">更多推荐</span>
            </a>
        </div>
    </div>
</div>
</html>